﻿using HuiLian.Common.Input;
using HuiLian.Common.Output;
using HuiLian.Model.Platform;
using HuiLian.Service.Platform.CallTime;
using HuiLian.Service.Platform.LoginCount;
using HuiLian.Service.Platform.LoginCount.Input;
using HuiLian.Service.Platform.LoginCount.Output;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;

namespace HuiLian.Web.Controllers.Platform
{
    /// <summary>
    /// 登录统计管理
    /// </summary>
    public class LoginCountController : AreaController
    {
        private readonly ILoginCountService _loginCountServices;

        public LoginCountController(ILoginCountService loginCountServices)
        {
            _loginCountServices = loginCountServices;
        }

        /// <summary>
        /// 获取指定用户Id的登录统计表信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IResponseOutput> GetUserLoginCount(long userId)
        {
            return await _loginCountServices.GetUserLoginCountAsync(userId);
        }

        ///// <summary>
        ///// 获取登录统计表信息
        ///// </summary>
        ///// <param name="id">主键</param>
        ///// <returns></returns>
        //[HttpGet]
        //public async Task<IResponseOutput> GetAsync(long id)
        //{
        //    return await _loginCountServices.GetAsync(id);
        //}

        ///// <summary>
        ///// 查询登录统计表信息
        ///// </summary>
        ///// <param name="input">分页信息</param>
        ///// <returns></returns>
        //[HttpPost]
        //public async Task<IResponseOutput> PageAsync(PageInput<LoginCountEntity> input)
        //{
        //    return await _loginCountServices.PageAsync(input);
        //}
    }
}
